import '../css/index.css';

function sum(...args) {
  return args.reduce((total, currentVal) => total + currentVal, 0);
}

// eslint-disable-next-line
console.log(sum(1, 1, 1, 1, 1, 1));

/*
  通过js代码，让某个文件被单独打包成一个chunk
*/
/*
package.json添加或修改parser解决eslint-loader import()报错
"eslintConfig": {
  "parser": "babel-eslint"
}
 */
import(/* webpackChunkName: 'test' */'./test')
  .then(({ mul, del }) => {
    // eslint-disable-next-line
    console.log(mul(1, 2));
  })
  .catch((res) => {
    // eslint-disable-next-line
    console.log(res);
  });
